import { Context, Session } from 'koishi'
import commandList from "./commandList";
const initCommand = (messageData: any, ctx: Context, session: Session) => {

    const content = messageData.message.content;
    
    commandList.map((commandItem) => {
        const hasAction = commandItem.alias.some(alias => alias === content);

        if (hasAction) {
            // 执行指令
            const fn = commandItem.fn;
            fn(messageData, ctx, session)
        }
    })
}

export default initCommand